home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware City / Comms / InterSLIP. folder / 3COM.script next >
Encoding:
Text File  |  1994-10-12  |  2.2 KB  |  116 lines  |  [TEXT/ttxt]

  1. !
  2. ! InterSLIP gateway script for 3Com terminal server
  3. !
  4. ! Label 99 is the general purpose error handler, which beeps
  5. ! and pauses long enough for the user to read the message.
  6. !
  7. ! First, we wait for the user name prompt
  8. !
  9. @originate
  10. note "Waiting for prompt"
  11. pause 100
  12. write "\13"
  13. matchclr
  14. matchstr 1 1 "NetLogin:"
  15. matchread 50
  16. note "No NetLogin prompt"
  17. jump 99
  18. !
  19. ! Now, send the user name and wait for the password prompt
  20. !
  21. @label 1
  22. note "Sending user name"
  23. write "^5\13"
  24. note "Waiting for Password"
  25. matchclr
  26. matchstr 1 2 "Password:"
  27. matchread 50
  28. note "No password prompt"
  29. jump 99
  30. !
  31. ! Send the password and wait for either the terminal server
  32. ! prompt or an error message
  33. !
  34. @label 2
  35. note "Sending password"
  36. write "^6\13"
  37. Note "Waiting for > prompt"
  38. pause 10
  39. matchclr
  40. matchstr 1 4 ">"
  41. matchstr 2 3 "Incorrect"
  42. matchread 260
  43. jump 99
  44. !
  45. ! If we got an error message, notify the user and fail
  46. !
  47. @label 3
  48. note "Accessed Denyed"
  49. pause 10
  50. jump 99
  51. !
  52. ! General purpose error handler.  Let the message appear,
  53. ! beep, and then pause for a second.
  54. !
  55. @label 99
  56. pause 1
  57. sound
  58. pause 60
  59. exit -1
  60. !
  61. ! If we've successfully logged in, ask for SLIP mode and
  62. ! wait for the response.  If we get anything except
  63. ! "Entering SLIP mode.", assume something went wrong, and fail.
  64. !
  65. @label 4
  66. note "Requesting SLIP; conn"
  67. write "cslip\13"
  68. matchclr
  69. matchstr 1 5 "conn"
  70. !matchstr 2 5 "IP"
  71. matchread 360
  72. note "Cannot invoke SLIP mode"
  73. jump 99
  74. !
  75. ! We've entered SLIP mode, so match on the first thing that
  76. ! looks like an IP address.  If we don't find one, fail.
  77. !
  78. @label 5
  79. note "Checking for IP Address"
  80. matchclr
  81. matchexp 1 6 "[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]"
  82. matchread 360
  83. note "No IP address given"
  84. jump 99
  85. !
  86. ! We've found an IP address, so inform MacTCP of it, and
  87. ! watch for a number (the MTU size).
  88. !
  89. @label 6
  90. setip "^0"
  91. !matchclr
  92. !matchexp 1 7 "[0-9][0-9]*"
  93. !matchread 120
  94. !note "No MTU value"
  95. !jump 99
  96. !
  97. ! We found the MTU size, so inform MacTCP and exit
  98. ! the script successfully.
  99. !
  100. !@label 7
  101. setmtu "1500"
  102. !setmtu "^0"
  103. !setmtu "1009"
  104. exit 0
  105. !
  106. ! Answer and Hangup modes are currently unused in gateway
  107. ! scripts, but just for future compatibility, exit successfully.
  108. !
  109. @answer
  110. @hangup
  111. write "+++"
  112. write "ath0"
  113. exit 0
  114.  
  115.  
  116.